#include "gameoverpage.h"
#include "director.h"
#include "ui_gameoverpage.h"
#include <QApplication>
#include <QDebug>
#include <QJsonObject>

GameOverPage::GameOverPage(QWidget *parent)
    : AbstractPage(parent), ui(new Ui::GameOverPage) {
  ui->setupUi(this);
}

GameOverPage::~GameOverPage() { delete ui; }

void GameOverPage::on_pushButton_clicked() { Director::instance()->backward(); }

void GameOverPage::on_pushButton_2_clicked() { qApp->quit(); }

void GameOverPage::updated() {
  if (Director::instance()->m_result) {
    ui->label->setText("你赢了");
  } else {
    ui->label->setText("你输了");
  }
}
